package com.relax.netty.zerocopy;

import java.io.DataInputStream;
import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

/**
 * 传统的io
 */
public class OldServer {
    public static void main(String[] args) throws IOException {
        final ServerSocket serverSocket = new ServerSocket(8899);
        while (true) {
            final Socket socket = serverSocket.accept();
            final DataInputStream dataInputStream = new DataInputStream(socket.getInputStream());
            try {
                byte[] bytes = new byte[1024];
                int read = 0;
                while (read != -1) {
                    read = dataInputStream.read(bytes, 0, bytes.length);

                }
            } catch (Exception e) {
                e.printStackTrace();
            }

        }
    }
}
